package com.wzu.rjgc_ks.config;

import com.wzu.rjgc_ks.loginInterceptor.LoginHandlerInterceptor;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.ViewControllerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

@Configuration
public class myconfig implements WebMvcConfigurer {
    @Override
    public void addViewControllers(ViewControllerRegistry registry) {
        registry.addViewController("/").setViewName("login.html");
    }

//    @Override
//    public void addInterceptors(InterceptorRegistry registry) {
//        // 添加拦截的请求，并排除几个不拦截的请求
//        String[] excludes=new String[]{"/","/user/index","/user/login","login.html","/static/**"};
//        registry.addInterceptor(new LoginHandlerInterceptor()).addPathPatterns("/**")
//                .excludePathPatterns(excludes);
//    }
}
